/********************************************************************************
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
 *                                                                              *
 *              This software is distributed under the terms of the             * 
 *              GNU Lesser General Public Licence (LGPL) version 3,             *  
 *                  copied verbatim in the file "LICENSE"                       *
 ********************************************************************************/
#ifndef HITPCUNPACKEDDATA_H
#define HITPCUNPACKEDDATA_H 1

#include <TObject.h>
#include <array>
// #include "TVector3.h"
// #include <map>
// #include <vector>


class TClonesArray;

class HiTpcUnpackedData: public TObject 
{

  public:

    /** Default constructor **/
    HiTpcUnpackedData();

    /** Standard constructor **/
    HiTpcUnpackedData(uint64_t TimeSliceID,
                    uint8_t pxiID, 
                    uint8_t feeID,
                    uint8_t ChannelId,
                    uint16_t TimeOffset,
                    const std::vector<uint16_t>& data
                    );


    /** Destructor **/
    virtual ~HiTpcUnpackedData();

    /** Output to screen **/
    virtual void Print(const Option_t* opt) const;

    /** Getter **/
    // const uint16_t (*GetWaveformData() const)[4096] { return fWaveformData; }
    uint64_t GetTimeSliceID() const { return fTimeSliceID; }
    uint8_t GetPxiID() const { return fPxiID; }
    uint8_t GetFeeID() const { return fFeeID; }
    uint8_t GetChannelID() const { return fChannelId; }
    uint16_t GetTimeOffset() const { return fTimeOffset; }
    const std::vector<uint16_t>& GetWaveformData() const { return fWaveformData; }
  private:
    // Data Members -----------------------
    uint64_t fTimeSliceID{};     // 时间片编号
    uint8_t fPxiID{};              // PXI板号
    uint8_t fFeeID{};              // FEE板号

    uint8_t fChannelId{};                 // 通道号
    uint16_t fTimeOffset{};            // 时间窗口内偏移
    std::vector<uint16_t> fWaveformData{};   // 波形数据

    ClassDef(HiTpcUnpackedData, 1)

};

#endif

